package com.servlet.web;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Title: UserServlet
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2023/12/22 11:22
 */
@WebServlet("/user")
public class UserServlet extends BaseServlet{

    /**
     * 新增方法
     */
    public void add(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        String username = req.getParameter("username");
        System.out.println(username);
        resp.getWriter().write("add...新增操作...");
    }

    /**
     * 修改方法
     */
    public void edit(HttpServletRequest req, HttpServletResponse resp) throws IOException{
        String username = req.getParameter("username");
        System.out.println(username);
        resp.getWriter().write("edit...修改操作...");
    }

    /**
     * 删除方法
     */
    public void delete(HttpServletRequest req, HttpServletResponse resp) throws IOException{
        resp.getWriter().write("delete...");
    }

    /**
     * 检索方法
     */
    public void query(HttpServletRequest req, HttpServletResponse resp) throws IOException{
        resp.getWriter().write("query...");
    }

}
